import request from '@/utils/request'

// 列表数据
export function queryProductList(data) {
  return request({
    url: '/v1/goods/spu/product-list',
    method: 'post',
    data
  })
}

// 币种
export function getCurrency(params) {
  return request({
    url: '/base/currency/get-list',
    method: 'get',
    params
  })
}

// 物流属性
export function getLogistics(params) {
  return request({
    url: '/base/logistics-attributes/get-list',
    method: 'get',
    params
  })
}

//品牌
export function getBrand(params) {
  return request({
    url: '/base/brand/get-list',
    method: 'get',
    params
  })
}

// 语言
export function getLanguage(params) {
  return request({
    url: '/base/language/get-list',
    method: 'get',
    params
  })
}

// 获取spu&sku
export function getSpu(data) {
  return request({
    url: '/v1/goods/spu/get-spu',
    method: 'post',
    data
  })
}

// 获取日志列表
export function getLogList(data) {
  return request({
    url: '/v1/goods/log/list',
    method: 'post',
    data
  })
}

// 创建商品
export function goodsCreate(data) {
  return request({
    url: '/v1/goods/spu/create',
    method: 'post',
    data
  })
}

// 编辑商品
export function goodsEdit(data) {
  return request({
    url: '/v1/goods/spu/edit',
    method: 'post',
    data
  })
}

export function gathering(data) {
  return request({
    url: '/v1/product/product/gathering',
    method: 'post',
    data
  })
}

// 商品详情
export function getDetail(data) {
  return request({
    url: '/v1/goods/spu/detail',
    method: 'post',
    data
  })
}

// 产品详情
export function getProductDetail(data) {
  return request({
    url: '/v1/product/product/detail',
    method: 'post',
    data
  })
}

export function review(data) {
  return request({
    url: '/v1/goods/sku/review',
    method: 'post',
    data
  })
}

// 商品SkU列表
export function querySkuList(data) {
  return request({
    url: '/v1/goods/sku/list',
    method: 'POST',
    data
  })
}

// 商品日志
export function queryLogList(data) {
  return request({
    url: '/v1/goods/log/list',
    method: 'POST',
    data
  })
}

// 商品日志
export function submitReview(data) {
  return request({
    url: '/v1/goods/sku/submit-review',
    method: 'POST',
    data
  })
}

// 删除商品
export function spuDelete(data) {
  return request({
    url: '/v1/goods/spu/delete',
    method: 'POST',
    data
  })
}

// 删除商品到回收池
export function skuRecycle(data) {
  return request({
    url: '/v1/goods/sku/recycle',
    method: 'POST',
    data
  })
}

// 检测编辑数据版本
export function checkEditVersion(data) {
  return request({
    url: '/v1/goods/spu/check-edit-version',
    method: 'POST',
    data
  })
}

// 商品SPU列表
export function querySpuList(data) {
  return request({
    url: '/v1/goods/spu/list',
    method: 'POST',
    data
  })
}

// 商品SPU统计
export function spuStatistics(data) {
  return request({
    url: '/v1/goods/spu/dev-status-statistics',
    method: 'POST',
    data
  })
}

// 保存为草稿
export function saveDraft(data) {
  return request({
    url: '/v1/goods/spu/save-draft',
    method: 'POST',
    data
  })
}

// 获取草稿
export function getDraft(data) {
  return request({
    url: '/v1/goods/spu/get-draft',
    method: 'POST',
    data
  })
}

// 删除草稿
export function delDraft(data) {
  return request({
    url: '/v1/goods/spu/del-draft',
    method: 'POST',
    data
  })
}

// 分类数据
export function getColumnsList() {
  return request({
    url: '/v1/base/base-back-columns/list',
    method: 'get'
  })
}

// 侵权检测
export function infringementDetection(data) {
  return request({
    url: '/v1/goods/spu/infringement-detection',
    method: 'post',
    data
  })
}

//获取sku图库图片
export function getSkuImg(data) {
  return request({
    url: '/v1/goods/sku/gallery-img',
    method: 'post',
    data
  })
}
//产品列表撤回状态
export function productStatus(data) {
  return request({
    url: '/v1/goods/sku-status-revocation',
    method: 'post',
    data
  })
}
//批量物流审批列表数据
export function logisticsList(data) {
  return request({
    url: '/v1/goods/logistic-check-list',
    method: 'post',
    data
  })
}
//物流批量审核
export function logisticsCheck(data) {
  return request({
    url: '/v1/goods/batch-logistic-check',
    method: 'post',
    data
  })
}

//编辑页获取锁
export function getLock(data) {
  return request({
    url: '/v1/goods/get-lock',
    method: 'post',
    data
  })
}
//编辑页解锁
export function unLock(data) {
  return request({
    url: '/v1/goods/spu-unlock',
    method: 'post',
    data
  })
}
//编辑页加锁
export function lock(data) {
  return request({
    url: '/v1/goods/spu-lock',
    method: 'post',
    data
  })
}

//供应商历史报价记录
export function supplierHistory(params) {
  return request({
    url: '/v1/goods/supplier/log',
    method: 'GET',
    params
  })
}

// 供应商列表
export function getSupplierList(data) {
  return request({
    baseURL: window.APP_GETEWAY.pms,
    url: '/v1/base/supplier',
    method: 'post',
    data
  })
}

//编辑-获取sku
export function getSKUInfo(data) {
  return request({
    url: '/v1/goods/spu/get-sku-info',
    method: 'post',
    data
  })
}

//批量解锁
export function batchUnlock(data) {
  return request({
    url: 'v1/goods/spu-unlock-special',
    method: 'post',
    data
  })
}

// 智能清洁状态提示
export function SKUCleanStatus(data) {
  return request({
    url: '/v1/goods/sku/clean-status',
    method: 'post',
    data
  })
}

// 生成智能清洁新老品-变更单
export function createClean(data) {
  return request({
    url: '/v1/goods/change-order/create-clean',
    method: 'post',
    data
  })
}

// 组合sku的子sku详情
export function getCombinationSKUChildDetail(params) {
  return request({
    url: '/v1/goods/combination-sku/child-detail',
    method: 'get',
    params
  })
}


// 获取辅料详情
export function getSKUDetails(data) {
  return request({
    url: '/v1/api/goods/sku/details',
    method: 'post',
    data
  })
}


// 商品详情分段保存
export function goodsRegionSave(data) {
  return request({
    url: '/v1/goods/spu/sharding-edit',
    method: 'post',
    data
  })
}

// 获取飞书审批详情
export function getFlowDetail(data) {
  return request({
    url: '/v1/goods/change-order/flow-detail',
    method: 'post',
    data
  })
}

// 获取部门管理员
export function getManageUser(data) {
  return request({
    url: '/v1/base/system/get-manage-user',
    method: 'post',
    data
  })
}

// 是否是其它sku的切换sku
export function isRelation(data) {
  return request({
    url: '/v1/goods/sku/is-relation',
    method: 'post',
    data
  })
}

//创建
export function purchaseDemandCreate(data) {
  return request({
    baseURL: window.APP_GETEWAY.pms,
    url: `/v1/purchase-demand/develop-demand/create`,
    method: "post",
    data,
  });
}